@agentrhq/webcmd 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +317 -24
- package/dist/src/adapter-shadow.d.ts +11 -0
- package/dist/src/adapter-shadow.js +72 -0
- package/dist/src/adapter-shadow.test.d.ts +1 -0
- package/dist/src/adapter-shadow.test.js +49 -0
- package/dist/src/adapter-source.d.ts +11 -0
- package/dist/src/adapter-source.js +24 -0
- package/dist/src/adapter-source.test.d.ts +1 -0
- package/dist/src/adapter-source.test.js +29 -0
- package/dist/src/brand.d.ts +9 -0
- package/dist/src/brand.js +9 -0
- package/dist/src/brand.test.d.ts +1 -0
- package/dist/src/brand.test.js +15 -0
- package/dist/src/browser/analyze.d.ts +118 -0
- package/dist/src/browser/analyze.js +405 -0
- package/dist/src/browser/analyze.test.d.ts +1 -0
- package/dist/src/browser/analyze.test.js +209 -0
- package/dist/src/browser/article-extract.d.ts +57 -0
- package/dist/src/browser/article-extract.e2e.test.d.ts +1 -0
- package/dist/src/browser/article-extract.e2e.test.js +105 -0
- package/dist/src/browser/article-extract.js +169 -0
- package/dist/src/browser/article-extract.test.d.ts +1 -0
- package/dist/src/browser/article-extract.test.js +94 -0
- package/dist/src/browser/ax-snapshot.d.ts +37 -0
- package/dist/src/browser/ax-snapshot.js +217 -0
- package/dist/src/browser/ax-snapshot.test.d.ts +1 -0
- package/dist/src/browser/ax-snapshot.test.js +91 -0
- package/dist/src/browser/base-page.d.ts +151 -0
- package/dist/src/browser/base-page.js +1060 -0
- package/dist/src/browser/base-page.test.d.ts +1 -0
- package/dist/src/browser/base-page.test.js +803 -0
- package/dist/src/browser/bridge-readiness.d.ts +14 -0
- package/dist/src/browser/bridge-readiness.js +24 -0
- package/dist/src/browser/bridge-readiness.test.d.ts +1 -0
- package/dist/src/browser/bridge-readiness.test.js +58 -0
- package/dist/src/browser/bridge.d.ts +26 -0
- package/dist/src/browser/bridge.js +58 -0
- package/dist/src/browser/cdp-click-fixture.test.d.ts +1 -0
- package/dist/src/browser/cdp-click-fixture.test.js +87 -0
- package/dist/src/browser/cdp.d.ts +46 -0
- package/dist/src/browser/cdp.js +536 -0
- package/dist/src/browser/cdp.test.d.ts +1 -0
- package/dist/src/browser/cdp.test.js +79 -0
- package/dist/src/browser/compound.d.ts +59 -0
- package/dist/src/browser/compound.js +112 -0
- package/dist/src/browser/compound.test.d.ts +1 -0
- package/dist/src/browser/compound.test.js +175 -0
- package/dist/src/browser/config.d.ts +2 -0
- package/dist/src/browser/config.js +14 -0
- package/dist/src/browser/daemon-client.d.ts +32 -0
- package/dist/src/browser/daemon-client.js +135 -0
- package/dist/src/browser/daemon-client.test.d.ts +1 -0
- package/dist/src/browser/daemon-client.test.js +326 -0
- package/dist/src/browser/daemon-lifecycle.d.ts +37 -0
- package/dist/src/browser/daemon-lifecycle.js +147 -0
- package/dist/src/browser/daemon-transport.d.ts +54 -0
- package/dist/src/browser/daemon-transport.js +68 -0
- package/dist/src/browser/daemon-version.d.ts +4 -0
- package/dist/src/browser/daemon-version.js +12 -0
- package/dist/src/browser/dom-helpers.d.ts +41 -0
- package/dist/src/browser/dom-helpers.js +239 -0
- package/dist/src/browser/dom-helpers.test.d.ts +1 -0
- package/dist/src/browser/dom-helpers.test.js +106 -0
- package/dist/src/browser/dom-snapshot.d.ts +93 -0
- package/dist/src/browser/dom-snapshot.js +894 -0
- package/dist/src/browser/dom-snapshot.test.d.ts +11 -0
- package/dist/src/browser/dom-snapshot.test.js +313 -0
- package/dist/src/browser/errors.d.ts +38 -0
- package/dist/src/browser/errors.js +79 -0
- package/dist/src/browser/errors.test.d.ts +1 -0
- package/dist/src/browser/errors.test.js +60 -0
- package/dist/src/browser/extract.d.ts +69 -0
- package/dist/src/browser/extract.js +132 -0
- package/dist/src/browser/extract.test.d.ts +1 -0
- package/dist/src/browser/extract.test.js +129 -0
- package/dist/src/browser/find.d.ts +84 -0
- package/dist/src/browser/find.js +398 -0
- package/dist/src/browser/find.test.d.ts +1 -0
- package/dist/src/browser/find.test.js +180 -0
- package/dist/src/browser/html-tree.d.ts +75 -0
- package/dist/src/browser/html-tree.js +112 -0
- package/dist/src/browser/html-tree.test.d.ts +1 -0
- package/dist/src/browser/html-tree.test.js +181 -0
- package/dist/src/browser/index.d.ts +14 -0
- package/dist/src/browser/index.js +12 -0
- package/dist/src/browser/network-cache.d.ts +49 -0
- package/dist/src/browser/network-cache.js +78 -0
- package/dist/src/browser/network-cache.test.d.ts +1 -0
- package/dist/src/browser/network-cache.test.js +75 -0
- package/dist/src/browser/network-interceptor.d.ts +11 -0
- package/dist/src/browser/network-interceptor.js +11 -0
- package/dist/src/browser/network-key.d.ts +22 -0
- package/dist/src/browser/network-key.js +66 -0
- package/dist/src/browser/network-key.test.d.ts +1 -0
- package/dist/src/browser/network-key.test.js +49 -0
- package/dist/src/browser/page.d.ts +83 -0
- package/dist/src/browser/page.js +453 -0
- package/dist/src/browser/page.test.d.ts +1 -0
- package/dist/src/browser/page.test.js +406 -0
- package/dist/src/browser/profile.d.ts +14 -0
- package/dist/src/browser/profile.js +86 -0
- package/dist/src/browser/protocol.d.ts +63 -0
- package/dist/src/browser/protocol.js +1 -0
- package/dist/src/browser/runtime/local-cloak/actions.d.ts +3 -0
- package/dist/src/browser/runtime/local-cloak/actions.js +240 -0
- package/dist/src/browser/runtime/local-cloak/downloads.d.ts +3 -0
- package/dist/src/browser/runtime/local-cloak/downloads.js +28 -0
- package/dist/src/browser/runtime/local-cloak/network.d.ts +28 -0
- package/dist/src/browser/runtime/local-cloak/network.js +120 -0
- package/dist/src/browser/runtime/local-cloak/network.test.d.ts +1 -0
- package/dist/src/browser/runtime/local-cloak/network.test.js +124 -0
- package/dist/src/browser/runtime/local-cloak/profiles.d.ts +6 -0
- package/dist/src/browser/runtime/local-cloak/profiles.js +17 -0
- package/dist/src/browser/runtime/local-cloak/profiles.test.d.ts +1 -0
- package/dist/src/browser/runtime/local-cloak/profiles.test.js +19 -0
- package/dist/src/browser/runtime/local-cloak/provider.d.ts +15 -0
- package/dist/src/browser/runtime/local-cloak/provider.js +27 -0
- package/dist/src/browser/runtime/local-cloak/provider.test.d.ts +1 -0
- package/dist/src/browser/runtime/local-cloak/provider.test.js +244 -0
- package/dist/src/browser/runtime/local-cloak/session-manager.d.ts +77 -0
- package/dist/src/browser/runtime/local-cloak/session-manager.js +280 -0
- package/dist/src/browser/runtime/local-cloak/session-manager.test.d.ts +1 -0
- package/dist/src/browser/runtime/local-cloak/session-manager.test.js +92 -0
- package/dist/src/browser/runtime/provider.d.ts +9 -0
- package/dist/src/browser/runtime/provider.js +1 -0
- package/dist/src/browser/runtime/provider.test.d.ts +2 -0
- package/dist/src/browser/runtime/provider.test.js +49 -0
- package/dist/src/browser/shape-filter.d.ts +52 -0
- package/dist/src/browser/shape-filter.js +101 -0
- package/dist/src/browser/shape-filter.test.d.ts +1 -0
- package/dist/src/browser/shape-filter.test.js +101 -0
- package/dist/src/browser/shape.d.ts +23 -0
- package/dist/src/browser/shape.js +95 -0
- package/dist/src/browser/shape.test.d.ts +1 -0
- package/dist/src/browser/shape.test.js +82 -0
- package/dist/src/browser/stealth.d.ts +11 -0
- package/dist/src/browser/stealth.js +359 -0
- package/dist/src/browser/stealth.test.d.ts +1 -0
- package/dist/src/browser/stealth.test.js +134 -0
- package/dist/src/browser/tabs.d.ts +13 -0
- package/dist/src/browser/tabs.js +70 -0
- package/dist/src/browser/target-errors.d.ts +39 -0
- package/dist/src/browser/target-errors.js +45 -0
- package/dist/src/browser/target-errors.test.d.ts +1 -0
- package/dist/src/browser/target-errors.test.js +94 -0
- package/dist/src/browser/target-resolver.d.ts +158 -0
- package/dist/src/browser/target-resolver.js +570 -0
- package/dist/src/browser/target-resolver.test.d.ts +1 -0
- package/dist/src/browser/target-resolver.test.js +118 -0
- package/dist/src/browser/utils.d.ts +20 -0
- package/dist/src/browser/utils.js +64 -0
- package/dist/src/browser/utils.test.d.ts +1 -0
- package/dist/src/browser/utils.test.js +29 -0
- package/dist/src/browser/verify-fixture.d.ts +65 -0
- package/dist/src/browser/verify-fixture.js +318 -0
- package/dist/src/browser/verify-fixture.test.d.ts +1 -0
- package/dist/src/browser/verify-fixture.test.js +219 -0
- package/dist/src/browser/visual-refs.d.ts +11 -0
- package/dist/src/browser/visual-refs.js +108 -0
- package/dist/src/browser.test.d.ts +1 -0
- package/dist/src/browser.test.js +297 -0
- package/dist/src/build-manifest.d.ts +103 -0
- package/dist/src/build-manifest.js +363 -0
- package/dist/src/build-manifest.test.d.ts +1 -0
- package/dist/src/build-manifest.test.js +341 -0
- package/dist/src/capabilityRouting.d.ts +19 -0
- package/dist/src/capabilityRouting.js +56 -0
- package/dist/src/capabilityRouting.test.d.ts +1 -0
- package/dist/src/capabilityRouting.test.js +63 -0
- package/dist/src/cli-argv-preprocess.d.ts +63 -0
- package/dist/src/cli-argv-preprocess.js +303 -0
- package/dist/src/cli-argv-preprocess.test.d.ts +1 -0
- package/dist/src/cli-argv-preprocess.test.js +304 -0
- package/dist/src/cli.d.ts +79 -0
- package/dist/src/cli.js +3350 -0
- package/dist/src/cli.test.d.ts +1 -0
- package/dist/src/cli.test.js +3041 -0
- package/dist/src/commanderAdapter.d.ts +21 -0
- package/dist/src/commanderAdapter.js +208 -0
- package/dist/src/commanderAdapter.test.d.ts +1 -0
- package/dist/src/commanderAdapter.test.js +352 -0
- package/dist/src/commands/auth.d.ts +40 -0
- package/dist/src/commands/auth.js +434 -0
- package/dist/src/commands/auth.test.d.ts +1 -0
- package/dist/src/commands/auth.test.js +252 -0
- package/dist/src/commands/daemon.d.ts +9 -0
- package/dist/src/commands/daemon.js +91 -0
- package/dist/src/commands/daemon.test.d.ts +1 -0
- package/dist/src/commands/daemon.test.js +293 -0
- package/dist/src/completion-fast.d.ts +22 -0
- package/dist/src/completion-fast.js +88 -0
- package/dist/src/completion-shared.d.ts +13 -0
- package/dist/src/completion-shared.js +61 -0
- package/dist/src/completion.d.ts +21 -0
- package/dist/src/completion.js +68 -0
- package/dist/src/completion.test.d.ts +1 -0
- package/dist/src/completion.test.js +24 -0
- package/dist/src/constants.d.ts +18 -0
- package/dist/src/constants.js +41 -0
- package/dist/src/convention-audit.d.ts +50 -0
- package/dist/src/convention-audit.js +553 -0
- package/dist/src/convention-audit.test.d.ts +1 -0
- package/dist/src/convention-audit.test.js +255 -0
- package/dist/src/daemon/server.d.ts +13 -0
- package/dist/src/daemon/server.js +185 -0
- package/dist/src/daemon/server.test.d.ts +1 -0
- package/dist/src/daemon/server.test.js +132 -0
- package/dist/src/daemon-utils.d.ts +18 -0
- package/dist/src/daemon-utils.js +37 -0
- package/dist/src/daemon.d.ts +1 -0
- package/dist/src/daemon.js +27 -0
- package/dist/src/daemon.test.d.ts +1 -0
- package/dist/src/daemon.test.js +60 -0
- package/dist/src/discovery.d.ts +46 -0
- package/dist/src/discovery.js +341 -0
- package/dist/src/doctor.d.ts +39 -0
- package/dist/src/doctor.js +168 -0
- package/dist/src/doctor.test.d.ts +1 -0
- package/dist/src/doctor.test.js +302 -0
- package/dist/src/download/article-download.d.ts +72 -0
- package/dist/src/download/article-download.js +305 -0
- package/dist/src/download/article-download.test.d.ts +1 -0
- package/dist/src/download/article-download.test.js +235 -0
- package/dist/src/download/index.d.ts +71 -0
- package/dist/src/download/index.js +363 -0
- package/dist/src/download/index.test.d.ts +1 -0
- package/dist/src/download/index.test.js +174 -0
- package/dist/src/download/media-download.d.ts +49 -0
- package/dist/src/download/media-download.js +127 -0
- package/dist/src/download/media-download.test.d.ts +1 -0
- package/dist/src/download/media-download.test.js +112 -0
- package/dist/src/download/progress.d.ts +36 -0
- package/dist/src/download/progress.js +120 -0
- package/dist/src/download/progress.test.d.ts +1 -0
- package/dist/src/download/progress.test.js +36 -0
- package/dist/src/electron-apps.d.ts +31 -0
- package/dist/src/electron-apps.js +91 -0
- package/dist/src/electron-apps.test.d.ts +1 -0
- package/dist/src/electron-apps.test.js +76 -0
- package/dist/src/engine.test.d.ts +1 -0
- package/dist/src/engine.test.js +312 -0
- package/dist/src/errors.d.ts +114 -0
- package/dist/src/errors.js +174 -0
- package/dist/src/errors.test.d.ts +1 -0
- package/dist/src/errors.test.js +109 -0
- package/dist/src/execution.d.ts +24 -0
- package/dist/src/execution.js +509 -0
- package/dist/src/execution.test.d.ts +1 -0
- package/dist/src/execution.test.js +645 -0
- package/dist/src/external.d.ts +49 -0
- package/dist/src/external.js +211 -0
- package/dist/src/external.test.d.ts +1 -0
- package/dist/src/external.test.js +110 -0
- package/dist/src/help.d.ts +88 -0
- package/dist/src/help.js +556 -0
- package/dist/src/help.test.d.ts +1 -0
- package/dist/src/help.test.js +58 -0
- package/dist/src/hooks.d.ts +46 -0
- package/dist/src/hooks.js +58 -0
- package/dist/src/hooks.test.d.ts +4 -0
- package/dist/src/hooks.test.js +92 -0
- package/dist/src/interceptor.d.ts +44 -0
- package/dist/src/interceptor.js +183 -0
- package/dist/src/interceptor.test.d.ts +4 -0
- package/dist/src/interceptor.test.js +81 -0
- package/dist/src/launcher.d.ts +41 -0
- package/dist/src/launcher.js +226 -0
- package/dist/src/launcher.test.d.ts +1 -0
- package/dist/src/launcher.test.js +153 -0
- package/dist/src/logger.d.ts +26 -0
- package/dist/src/logger.js +49 -0
- package/dist/src/main.d.ts +5 -0
- package/dist/src/main.js +177 -0
- package/dist/src/manifest-types.d.ts +43 -0
- package/dist/src/manifest-types.js +9 -0
- package/dist/src/node-network.d.ts +10 -0
- package/dist/src/node-network.js +174 -0
- package/dist/src/node-network.test.d.ts +1 -0
- package/dist/src/node-network.test.js +55 -0
- package/dist/src/observation/artifact.d.ts +16 -0
- package/dist/src/observation/artifact.js +260 -0
- package/dist/src/observation/artifact.test.d.ts +1 -0
- package/dist/src/observation/artifact.test.js +121 -0
- package/dist/src/observation/events.d.ts +89 -0
- package/dist/src/observation/events.js +1 -0
- package/dist/src/observation/index.d.ts +7 -0
- package/dist/src/observation/index.js +7 -0
- package/dist/src/observation/manager.d.ts +9 -0
- package/dist/src/observation/manager.js +27 -0
- package/dist/src/observation/manager.test.d.ts +1 -0
- package/dist/src/observation/manager.test.js +13 -0
- package/dist/src/observation/redaction.d.ts +11 -0
- package/dist/src/observation/redaction.js +81 -0
- package/dist/src/observation/redaction.test.d.ts +1 -0
- package/dist/src/observation/redaction.test.js +32 -0
- package/dist/src/observation/retention.d.ts +32 -0
- package/dist/src/observation/retention.js +160 -0
- package/dist/src/observation/retention.test.d.ts +1 -0
- package/dist/src/observation/retention.test.js +118 -0
- package/dist/src/observation/ring-buffer.d.ts +22 -0
- package/dist/src/observation/ring-buffer.js +45 -0
- package/dist/src/observation/ring-buffer.test.d.ts +1 -0
- package/dist/src/observation/ring-buffer.test.js +22 -0
- package/dist/src/observation/session.d.ts +25 -0
- package/dist/src/observation/session.js +50 -0
- package/dist/src/output.d.ts +14 -0
- package/dist/src/output.js +152 -0
- package/dist/src/output.test.d.ts +1 -0
- package/dist/src/output.test.js +53 -0
- package/dist/src/package-exports.test.d.ts +1 -0
- package/dist/src/package-exports.test.js +112 -0
- package/dist/src/package-paths.d.ts +8 -0
- package/dist/src/package-paths.js +41 -0
- package/dist/src/pipeline/executor.d.ts +11 -0
- package/dist/src/pipeline/executor.js +93 -0
- package/dist/src/pipeline/executor.test.d.ts +4 -0
- package/dist/src/pipeline/executor.test.js +182 -0
- package/dist/src/pipeline/index.d.ts +5 -0
- package/dist/src/pipeline/index.js +5 -0
- package/dist/src/pipeline/registry.d.ts +28 -0
- package/dist/src/pipeline/registry.js +55 -0
- package/dist/src/pipeline/steps/browser.d.ts +13 -0
- package/dist/src/pipeline/steps/browser.js +86 -0
- package/dist/src/pipeline/steps/download.d.ts +18 -0
- package/dist/src/pipeline/steps/download.js +252 -0
- package/dist/src/pipeline/steps/download.test.d.ts +1 -0
- package/dist/src/pipeline/steps/download.test.js +102 -0
- package/dist/src/pipeline/steps/fetch.d.ts +5 -0
- package/dist/src/pipeline/steps/fetch.js +122 -0
- package/dist/src/pipeline/steps/fetch.test.d.ts +1 -0
- package/dist/src/pipeline/steps/fetch.test.js +117 -0
- package/dist/src/pipeline/steps/intercept.d.ts +5 -0
- package/dist/src/pipeline/steps/intercept.js +50 -0
- package/dist/src/pipeline/steps/tap.d.ts +12 -0
- package/dist/src/pipeline/steps/tap.js +93 -0
- package/dist/src/pipeline/steps/transform.d.ts +9 -0
- package/dist/src/pipeline/steps/transform.js +70 -0
- package/dist/src/pipeline/template.d.ts +17 -0
- package/dist/src/pipeline/template.js +344 -0
- package/dist/src/pipeline/template.test.d.ts +4 -0
- package/dist/src/pipeline/template.test.js +197 -0
- package/dist/src/pipeline/transform.test.d.ts +4 -0
- package/dist/src/pipeline/transform.test.js +133 -0
- package/dist/src/plugin-manifest.d.ts +70 -0
- package/dist/src/plugin-manifest.js +160 -0
- package/dist/src/plugin-manifest.test.d.ts +4 -0
- package/dist/src/plugin-manifest.test.js +179 -0
- package/dist/src/plugin-scaffold.d.ts +28 -0
- package/dist/src/plugin-scaffold.js +143 -0
- package/dist/src/plugin-scaffold.test.d.ts +4 -0
- package/dist/src/plugin-scaffold.test.js +83 -0
- package/dist/src/plugin.d.ts +146 -0
- package/dist/src/plugin.js +1303 -0
- package/dist/src/plugin.test.d.ts +4 -0
- package/dist/src/plugin.test.js +1363 -0
- package/dist/src/registry-api.d.ts +13 -0
- package/dist/src/registry-api.js +10 -0
- package/dist/src/registry.d.ts +123 -0
- package/dist/src/registry.js +125 -0
- package/dist/src/registry.test.d.ts +4 -0
- package/dist/src/registry.test.js +209 -0
- package/dist/src/runtime-copy.test.d.ts +1 -0
- package/dist/src/runtime-copy.test.js +29 -0
- package/dist/src/runtime-detect.d.ts +31 -0
- package/dist/src/runtime-detect.js +47 -0
- package/dist/src/runtime-detect.test.d.ts +1 -0
- package/dist/src/runtime-detect.test.js +39 -0
- package/dist/src/runtime-identity.test.d.ts +1 -0
- package/dist/src/runtime-identity.test.js +18 -0
- package/dist/src/runtime.d.ts +47 -0
- package/dist/src/runtime.js +54 -0
- package/dist/src/scripts/framework.d.ts +7 -0
- package/dist/src/scripts/framework.js +25 -0
- package/dist/src/scripts/interact.d.ts +4 -0
- package/dist/src/scripts/interact.js +20 -0
- package/dist/src/scripts/store.d.ts +13 -0
- package/dist/src/scripts/store.js +48 -0
- package/dist/src/serialization.d.ts +42 -0
- package/dist/src/serialization.js +103 -0
- package/dist/src/serialization.test.d.ts +1 -0
- package/dist/src/serialization.test.js +78 -0
- package/dist/src/skills.d.ts +14 -0
- package/dist/src/skills.js +127 -0
- package/dist/src/skills.test.d.ts +1 -0
- package/dist/src/skills.test.js +71 -0
- package/dist/src/snapshotFormatter.d.ts +11 -0
- package/dist/src/snapshotFormatter.js +338 -0
- package/dist/src/snapshotFormatter.test.d.ts +7 -0
- package/dist/src/snapshotFormatter.test.js +521 -0
- package/dist/src/tui.d.ts +28 -0
- package/dist/src/tui.js +179 -0
- package/dist/src/tui.test.d.ts +1 -0
- package/dist/src/tui.test.js +19 -0
- package/dist/src/types.d.ts +236 -0
- package/dist/src/types.js +7 -0
- package/dist/src/update-check.d.ts +66 -0
- package/dist/src/update-check.js +206 -0
- package/dist/src/update-check.test.d.ts +1 -0
- package/dist/src/update-check.test.js +117 -0
- package/dist/src/utils.d.ts +57 -0
- package/dist/src/utils.js +152 -0
- package/dist/src/utils.test.d.ts +1 -0
- package/dist/src/utils.test.js +155 -0
- package/dist/src/validate.d.ts +21 -0
- package/dist/src/validate.js +130 -0
- package/dist/src/validate.test.d.ts +9 -0
- package/dist/src/validate.test.js +90 -0
- package/dist/src/verify.d.ts +26 -0
- package/dist/src/verify.js +67 -0
- package/dist/src/version.d.ts +4 -0
- package/dist/src/version.js +22 -0
- package/dist/src/weixin-download.test.d.ts +1 -0
- package/dist/src/weixin-download.test.js +45 -0
- package/package.json +4 -3
- package/scripts/check-package-bin.mjs +95 -0
package/README.md
CHANGED
|
@@ -1,44 +1,337 @@
|
|
|
1
|
-
|
|
1
|
+
<img width="2054" height="766" alt="Group 52" src="https://github.com/user-attachments/assets/9080bdf2-55c5-4522-9137-18eeb12f417d" />
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
# Webcmd
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
<p align="center">
|
|
6
|
+
<a href="https://www.npmjs.com/package/@agentrhq/webcmd">
|
|
7
|
+
<img alt="NPM version" src="https://img.shields.io/npm/v/@agentrhq/webcmd.svg?style=for-the-badge&color=1E88E5&labelColor=000000">
|
|
8
|
+
</a>
|
|
9
|
+
|
|
10
|
+
<a href="https://github.com/agentrhq/webcmd/blob/main/LICENSE">
|
|
11
|
+
<img alt="License" src="https://img.shields.io/npm/l/@agentrhq/webcmd.svg?style=for-the-badge&color=1E88E5&labelColor=000000">
|
|
12
|
+
</a>
|
|
13
|
+
|
|
14
|
+
<a href="https://github.com/agentrhq/webcmd/discussions">
|
|
15
|
+
<img alt="Join the community on GitHub" src="https://img.shields.io/badge/Join%20the%20community-1E88E5.svg?style=for-the-badge&logo=github&labelColor=000000&logoWidth=20">
|
|
16
|
+
</a>
|
|
17
|
+
</p>
|
|
18
|
+
|
|
19
|
+
**Teach a coding agent a website once. Get back a script it can run forever.**
|
|
20
|
+
|
|
21
|
+
Coding agents are great at driving a browser and terrible at remembering how. Every session they re-learn the same login, the same clicks, the same fragile selectors. Webcmd records a real browser task session, distills it into a durable capability graph for that app, and materializes the result as a deterministic workflow script or a standalone task CLI — so the next run is one command instead of another exploratory crawl.
|
|
22
|
+
|
|
23
|
+
> **Screen recording / demo goes here.**
|
|
6
24
|
|
|
7
25
|
```bash
|
|
8
|
-
node --version
|
|
9
26
|
npm install -g @agentrhq/webcmd
|
|
10
|
-
webcmd
|
|
27
|
+
webcmd setup
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## How it works
|
|
33
|
+
|
|
34
|
+
Webcmd turns one messy browser session into reusable, deterministic artifacts through five stages:
|
|
35
|
+
|
|
36
|
+
1. **Record** — open a browser session with `webcmd open`. Everything is captured to a raw **journal** (DOM snapshots, actions, and redacted network evidence) by default.
|
|
37
|
+
2. **Inspect** — read the journal and review captured network calls to understand what the task actually did and which requests had side effects.
|
|
38
|
+
3. **Distill** — collapse the journal into the app's **capability graph**: the durable, deduplicated model of what this app can do.
|
|
39
|
+
4. **Materialize** — emit a **workflow** (a deterministic `.mjs` replay script) or a **CLI** (a standalone package grounded in graph capabilities, shipped with its own `SKILL.md`).
|
|
40
|
+
5. **Run** — replay the workflow or invoke the generated CLI. Deterministic, no live exploration.
|
|
41
|
+
|
|
42
|
+
### Vocabulary
|
|
43
|
+
|
|
44
|
+
| Term | What it is |
|
|
45
|
+
|------|-----------|
|
|
46
|
+
| **Session** | A live browser run, identified by `--session <name>`. Records by default. |
|
|
47
|
+
| **Journal** | The raw event log of a session — snapshots, actions, network evidence. |
|
|
48
|
+
| **Snapshot** | A semantic capture of page state. Webcmd can diff two snapshots. |
|
|
49
|
+
| **Capability graph** | The distilled, durable model of an app's capabilities, built from journals. |
|
|
50
|
+
| **Workflow** | A deterministic `.mjs` script that replays a task. No `SKILL.md`. |
|
|
51
|
+
| **CLI** | A standalone package generated from graph capabilities. Ships a `SKILL.md`. |
|
|
52
|
+
| **Profile** | A workspace identity context under `.webcmd/profiles/<name>` — may hold auth for several apps. |
|
|
53
|
+
| **Authoring packet** | A planning step that decides the safe next action when creating, updating, or healing an artifact. |
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Quick start (golden path)
|
|
58
|
+
|
|
59
|
+
From an empty workspace to a runnable CLI:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
# 1. Install skills and prepare runtime
|
|
63
|
+
webcmd setup
|
|
64
|
+
|
|
65
|
+
# 2. Record a task in a headed browser (this shell stays alive until close)
|
|
66
|
+
webcmd open "https://news.ycombinator.com" --session hn --headed
|
|
67
|
+
|
|
68
|
+
# 3. From another shell, drive and inspect the session
|
|
69
|
+
webcmd snapshot --session hn
|
|
70
|
+
webcmd click --session hn --role link --name "Learn more"
|
|
71
|
+
webcmd network summary --session hn
|
|
72
|
+
|
|
73
|
+
# 4. Let the authoring packet pick the safe next step
|
|
74
|
+
webcmd author cli --operation create \
|
|
75
|
+
--task "Collect top Hacker News posts" \
|
|
76
|
+
--app-id hacker-news \
|
|
77
|
+
--url https://news.ycombinator.com
|
|
78
|
+
|
|
79
|
+
# 5. Materialize the CLI from a plan, then run it
|
|
80
|
+
webcmd cli hacker-news --plan <plan.json>
|
|
81
|
+
webcmd run top-posts
|
|
82
|
+
|
|
83
|
+
# 6. Done — close the session
|
|
84
|
+
webcmd close --session hn
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Sessions record by default; pass `--no-record` only for ephemeral sessions.
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## For AI agents
|
|
92
|
+
|
|
93
|
+
Webcmd is built to be driven by a coding agent (Claude Code, Cursor, and similar), not typed by hand.
|
|
94
|
+
|
|
95
|
+
**Install the skills.** `webcmd setup` installs the canonical Webcmd skills so your agent knows how to record, inspect, distill, and materialize.
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
webcmd setup # global: ~/.agents/skills/
|
|
99
|
+
webcmd setup --scope local # workspace: .agents/skills/
|
|
100
|
+
webcmd setup --skills-root /path/to/.agents/skills
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**Generated CLIs teach the next agent.** Every CLI Webcmd materializes ships with a `SKILL.md` whose frontmatter records command metadata, graph-capability provenance, and safe smoke tests. Install it alongside the CLI or into a shared skills root:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
webcmd cli <app-id> --plan <plan.json> --install-skill
|
|
107
|
+
webcmd cli <app-id> --plan <plan.json> --install-skill /path/to/skills
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Workflows never get a `SKILL.md`; CLIs always do.
|
|
111
|
+
|
|
112
|
+
**The primitives your agent drives.** Open a session, then control it from another shell:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
webcmd snapshot --session default
|
|
116
|
+
webcmd click --session default --role link --name "Learn more"
|
|
117
|
+
webcmd press Enter --session default
|
|
118
|
+
webcmd goto "https://example.com" --session default
|
|
119
|
+
webcmd wait url_contains "example.com" --session default --timeout-ms 5000
|
|
120
|
+
webcmd close --session default
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## Browser runtime
|
|
126
|
+
|
|
127
|
+
Webcmd opens a **CloakBrowser**-backed session by default:
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
webcmd open "https://example.com" --session default
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Run headed when you need to watch or hand off — the command stays alive until the session closes:
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
webcmd open "https://example.com" --session default --headed
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Use stock Playwright Chromium explicitly when you'd rather not use CloakBrowser (install browsers first):
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
npm run browsers:install
|
|
143
|
+
webcmd open "https://example.com" --browser chromium
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### Profiles and identity
|
|
147
|
+
|
|
148
|
+
Named profiles are workspace identity contexts under `.webcmd/profiles/<name>`. A single profile can carry auth for more than one app. Use `default` for the normal workspace identity:
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
webcmd open "https://accounts.google.com" --session login --headed \
|
|
152
|
+
--profile default --browser chromium --channel chrome
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Or point at a dedicated absolute profile directory:
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
webcmd open "https://accounts.google.com" --session google --headed \
|
|
159
|
+
--user-data-dir /absolute/dedicated/profile --browser chromium --channel chrome
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
> **Do not** point `--user-data-dir` at your daily Chrome profile while Chrome is open. Use a dedicated Webcmd profile.
|
|
163
|
+
|
|
164
|
+
Generated workflows and CLIs that initialize with `auth: true` reuse `.webcmd/profiles/default` unless the caller passes another `profile` or `userDataDir`.
|
|
165
|
+
|
|
166
|
+
### Auth-aware graphs
|
|
167
|
+
|
|
168
|
+
Validate profile state and open a headed login flow:
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
webcmd auth doctor linkedin --profile default
|
|
172
|
+
webcmd auth login linkedin --profile default --browser chromium --channel chrome
|
|
173
|
+
webcmd auth bind linkedin --session login
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### Optional Camofox provider
|
|
177
|
+
|
|
178
|
+
Use Camofox when a normal Playwright browser is blocked:
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
webcmd open https://example.com --browser camofox --camofox-url http://localhost:3000
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## Network inspection
|
|
187
|
+
|
|
188
|
+
Captured sessions write redacted request evidence to `.webcmd/sessions/<session>/network.jsonl`; reviewer marks live separately in `network.marks.json`.
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
webcmd network list --session default --method POST
|
|
192
|
+
webcmd network show n1 --session default
|
|
193
|
+
webcmd network summary --session default
|
|
194
|
+
webcmd network candidates --session default
|
|
195
|
+
webcmd network mark n1 --session default --mark side-effect
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
Marking side-effecting requests helps the distill step reason about which calls are safe to replay.
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## Authoring, distilling & materializing
|
|
203
|
+
|
|
204
|
+
### Authoring packets
|
|
205
|
+
|
|
206
|
+
Use an authoring packet when the user asks to **create**, **update**, or **heal** a CLI or workflow and you need to decide whether existing graph evidence is enough.
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
webcmd author cli --operation create --task "Create a Hacker News CLI" --app-id hacker-news --url https://news.ycombinator.com
|
|
210
|
+
webcmd author cli --operation update --task "Add saved jobs" --app-id linkedin
|
|
211
|
+
webcmd author cli --operation heal --task "jobs search fails" --app-id linkedin --target .webcmd/exports/clis/www.linkedin.com
|
|
212
|
+
|
|
213
|
+
webcmd author workflow --operation create --task "Collect top Hacker News posts" --app-id hacker-news --url https://news.ycombinator.com
|
|
214
|
+
webcmd author workflow --operation update --task "Return JSON with title and URL" --app-id hacker-news
|
|
215
|
+
webcmd author workflow --operation heal --task "top posts workflow no longer finds titles" --app-id hacker-news --target .webcmd/exports/workflows/news.ycombinator.com/top-posts.mjs
|
|
11
216
|
```
|
|
12
217
|
|
|
13
|
-
|
|
218
|
+
The packet tells the agent which phase to run next:
|
|
14
219
|
|
|
15
|
-
|
|
220
|
+
| Phase | What to do |
|
|
221
|
+
|-------|-----------|
|
|
222
|
+
| `discovery` | Record browser and network evidence within the discovery budget. |
|
|
223
|
+
| `distill` | Distill existing recorded sessions into the graph. |
|
|
224
|
+
| `build` | Prepare a CLI or workflow materialization packet. |
|
|
225
|
+
| `repair` | Reproduce and classify the failure before patching. |
|
|
16
226
|
|
|
17
|
-
|
|
227
|
+
The packet only chooses the safe next step — the actual artifact always comes from `webcmd cli`, `webcmd workflow`, and `webcmd verify`.
|
|
18
228
|
|
|
19
|
-
|
|
229
|
+
### Materialization exports
|
|
20
230
|
|
|
21
231
|
```bash
|
|
22
|
-
webcmd
|
|
23
|
-
webcmd
|
|
232
|
+
webcmd workflow <app-id> --plan <plan.json>
|
|
233
|
+
webcmd workflow list
|
|
234
|
+
webcmd run <workflow_name>
|
|
235
|
+
webcmd run <domain>/<workflow_name>
|
|
236
|
+
webcmd run <workflow_name> --help
|
|
237
|
+
|
|
238
|
+
webcmd cli <app-id> --plan <plan.json>
|
|
239
|
+
webcmd cli <app-id> --plan <plan.json> --install-skill
|
|
24
240
|
```
|
|
25
241
|
|
|
26
|
-
|
|
242
|
+
- Workflows export to `~/.webcmd/exports/workflows/<domain>/<workflow-name>.mjs`.
|
|
243
|
+
- CLIs export to `~/.webcmd/exports/clis/<domain>/` as standalone packages grounded in graph capabilities.
|
|
244
|
+
|
|
245
|
+
---
|
|
246
|
+
|
|
247
|
+
## User handoff
|
|
248
|
+
|
|
249
|
+
Pause for a human to demonstrate a step, then resume from the user-authored journal events:
|
|
27
250
|
|
|
28
251
|
```bash
|
|
29
|
-
webcmd
|
|
30
|
-
|
|
31
|
-
webcmd
|
|
32
|
-
webcmd browser work open https://example.com
|
|
252
|
+
webcmd handoff --session default
|
|
253
|
+
# user demonstrates the workflow in the headed browser
|
|
254
|
+
webcmd resume --session default
|
|
33
255
|
```
|
|
34
256
|
|
|
35
|
-
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## Reading a session
|
|
260
|
+
|
|
261
|
+
```bash
|
|
262
|
+
webcmd journal # read an existing recorded session
|
|
263
|
+
webcmd run <name> # execute an exported workflow .mjs
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
---
|
|
267
|
+
|
|
268
|
+
## Configuration reference
|
|
269
|
+
|
|
270
|
+
| Path | Purpose |
|
|
271
|
+
|------|---------|
|
|
272
|
+
| `~/.agents/skills/` | Global skills install target (`webcmd setup`). |
|
|
273
|
+
| `.agents/skills/` | Local/workspace skills (`webcmd setup --scope local`). |
|
|
274
|
+
| `.webcmd/` | Runtime state — created automatically when needed. |
|
|
275
|
+
| `.webcmd/profiles/<name>` | Named identity profiles (auth, storage). |
|
|
276
|
+
| `.webcmd/sessions/<session>/network.jsonl` | Redacted request evidence. |
|
|
277
|
+
| `.webcmd/sessions/<session>/network.marks.json` | Reviewer marks. |
|
|
278
|
+
| `~/.webcmd/exports/workflows/<domain>/` | Exported workflow `.mjs` scripts. |
|
|
279
|
+
| `~/.webcmd/exports/clis/<domain>/` | Exported standalone CLI packages. |
|
|
280
|
+
|
|
281
|
+
Common flags: `--session <name>`, `--profile <name>`, `--browser <cloak\|chromium\|camofox>`, `--channel chrome`, `--headed`, `--no-record`, `--user-data-dir <path>`, `--timeout-ms <n>`.
|
|
282
|
+
|
|
283
|
+
---
|
|
284
|
+
|
|
285
|
+
## Troubleshooting
|
|
286
|
+
|
|
287
|
+
- **`--user-data-dir` conflict / profile locked** — Chrome is likely open on that profile. Close Chrome or use a dedicated Webcmd profile under `.webcmd/profiles/<name>`.
|
|
288
|
+
- **Auth check fails** — run `webcmd auth doctor <app> --profile default`, then `webcmd auth login <app> ...` and re-bind with `webcmd auth bind <app> --session login`.
|
|
289
|
+
- **Browser is blocked / bot-walled** — retry with the Camofox provider: `--browser camofox --camofox-url http://localhost:3000`.
|
|
290
|
+
- **Stock Chromium missing** — run `npm run browsers:install` before using `--browser chromium`.
|
|
291
|
+
- **Session not found** — confirm the `--session` name matches the one used with `webcmd open`; headed sessions must still be alive.
|
|
292
|
+
- **Node errors on startup** — Webcmd requires Node >= 20. Check `node --version` and upgrade.
|
|
293
|
+
|
|
294
|
+
<!-- TODO: document output formats and exit codes here once finalized —
|
|
295
|
+
both are high-value for agents/CI branching on results. -->
|
|
296
|
+
|
|
297
|
+
---
|
|
298
|
+
|
|
299
|
+
## Installation
|
|
300
|
+
|
|
301
|
+
Webcmd requires **Node >= 20**.
|
|
302
|
+
|
|
303
|
+
```bash
|
|
304
|
+
npm install -g @agentrhq/webcmd
|
|
305
|
+
webcmd --help
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
One-off usage without a global install:
|
|
309
|
+
|
|
310
|
+
```bash
|
|
311
|
+
npx @agentrhq/webcmd --help
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
---
|
|
315
|
+
|
|
316
|
+
## Development
|
|
317
|
+
|
|
318
|
+
```bash
|
|
319
|
+
npm install
|
|
320
|
+
npm test
|
|
321
|
+
npm run check
|
|
322
|
+
npm run build
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
---
|
|
326
|
+
|
|
327
|
+
## Contributing & releases
|
|
328
|
+
|
|
329
|
+
Release engineering (Release Please, Conventional Commits, npm Trusted Publishing, and first-publish bootstrap) is documented separately in [`CONTRIBUTING.md`](./CONTRIBUTING.md) .
|
|
330
|
+
|
|
331
|
+
In short: `fix:` → patch, `feat:` → minor, `!` or `BREAKING CHANGE:` → major. CI runs `npm ci && npm run check && npm test && npm run build && npm pack --dry-run` on every push and PR; merging the Release Please PR cuts the GitHub release and publishes to npm.
|
|
332
|
+
|
|
333
|
+
---
|
|
36
334
|
|
|
37
|
-
|
|
335
|
+
## License
|
|
38
336
|
|
|
39
|
-
|
|
40
|
-
- `webcmd-browser-sitemap`
|
|
41
|
-
- `webcmd-adapter-author`
|
|
42
|
-
- `webcmd-autofix`
|
|
43
|
-
- `webcmd-sitemap-author`
|
|
44
|
-
- `webcmd-usage`
|
|
337
|
+
Released under the terms in [`LICENSE`](./LICENSE).
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type AdapterShadow = {
|
|
2
|
+
name: string;
|
|
3
|
+
userPath: string;
|
|
4
|
+
builtinPath: string;
|
|
5
|
+
};
|
|
6
|
+
export type AdapterShadowOptions = {
|
|
7
|
+
userClisDir?: string;
|
|
8
|
+
builtinClisDir?: string;
|
|
9
|
+
};
|
|
10
|
+
export declare function findShadowedUserAdapters(opts?: AdapterShadowOptions): AdapterShadow[];
|
|
11
|
+
export declare function formatAdapterShadowIssue(shadows: AdapterShadow[]): string;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import * as fs from 'node:fs';
|
|
2
|
+
import * as os from 'node:os';
|
|
3
|
+
import * as path from 'node:path';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
import { findPackageRoot, getCliManifestPath } from './package-paths.js';
|
|
6
|
+
function defaultBuiltinClisDir() {
|
|
7
|
+
return path.join(findPackageRoot(fileURLToPath(import.meta.url)), 'clis');
|
|
8
|
+
}
|
|
9
|
+
function safeReaddir(dir) {
|
|
10
|
+
try {
|
|
11
|
+
return fs.readdirSync(dir, { withFileTypes: true });
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
return [];
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function loadBuiltinCommandFiles(builtinClisDir) {
|
|
18
|
+
try {
|
|
19
|
+
const raw = fs.readFileSync(getCliManifestPath(builtinClisDir), 'utf-8');
|
|
20
|
+
const entries = JSON.parse(raw);
|
|
21
|
+
const files = new Set();
|
|
22
|
+
for (const entry of entries) {
|
|
23
|
+
const rel = entry.sourceFile ?? entry.modulePath;
|
|
24
|
+
if (rel)
|
|
25
|
+
files.add(path.resolve(builtinClisDir, rel));
|
|
26
|
+
}
|
|
27
|
+
return files;
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
return new Set();
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export function findShadowedUserAdapters(opts = {}) {
|
|
34
|
+
const userClisDir = opts.userClisDir ?? path.join(os.homedir(), '.webcmd', 'clis');
|
|
35
|
+
const builtinClisDir = opts.builtinClisDir ?? defaultBuiltinClisDir();
|
|
36
|
+
const builtinCommandFiles = loadBuiltinCommandFiles(builtinClisDir);
|
|
37
|
+
const shadows = [];
|
|
38
|
+
for (const siteEntry of safeReaddir(userClisDir)) {
|
|
39
|
+
if (!siteEntry.isDirectory())
|
|
40
|
+
continue;
|
|
41
|
+
const site = siteEntry.name;
|
|
42
|
+
const userSiteDir = path.join(userClisDir, site);
|
|
43
|
+
const builtinSiteDir = path.join(builtinClisDir, site);
|
|
44
|
+
for (const commandEntry of safeReaddir(userSiteDir)) {
|
|
45
|
+
if (!commandEntry.isFile() || !commandEntry.name.endsWith('.js'))
|
|
46
|
+
continue;
|
|
47
|
+
const userPath = path.join(userSiteDir, commandEntry.name);
|
|
48
|
+
const builtinPath = path.join(builtinSiteDir, commandEntry.name);
|
|
49
|
+
const builtinResolved = path.resolve(builtinPath);
|
|
50
|
+
if (!builtinCommandFiles.has(builtinResolved))
|
|
51
|
+
continue;
|
|
52
|
+
shadows.push({
|
|
53
|
+
name: `${site}/${commandEntry.name.replace(/\.js$/, '')}`,
|
|
54
|
+
userPath,
|
|
55
|
+
builtinPath,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return shadows.sort((a, b) => a.name.localeCompare(b.name));
|
|
60
|
+
}
|
|
61
|
+
export function formatAdapterShadowIssue(shadows) {
|
|
62
|
+
const visible = shadows.slice(0, 10);
|
|
63
|
+
const lines = ['Local adapter overrides shadow packaged adapters:'];
|
|
64
|
+
for (const shadow of visible) {
|
|
65
|
+
lines.push(` ${shadow.name}: ${shadow.userPath} overrides ${shadow.builtinPath}`);
|
|
66
|
+
}
|
|
67
|
+
if (shadows.length > visible.length) {
|
|
68
|
+
lines.push(` ... and ${shadows.length - visible.length} more`);
|
|
69
|
+
}
|
|
70
|
+
lines.push('Remove the local ~/.webcmd/clis copy, or run webcmd adapter reset <site>, when you want packaged updates.');
|
|
71
|
+
return lines.join('\n');
|
|
72
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import * as fs from 'node:fs';
|
|
3
|
+
import * as os from 'node:os';
|
|
4
|
+
import * as path from 'node:path';
|
|
5
|
+
import { findShadowedUserAdapters, formatAdapterShadowIssue } from './adapter-shadow.js';
|
|
6
|
+
describe('adapter shadow detection', () => {
|
|
7
|
+
it('reports user adapters that shadow packaged manifest commands', () => {
|
|
8
|
+
const root = fs.mkdtempSync(path.join(os.tmpdir(), 'webcmd-adapter-shadow-'));
|
|
9
|
+
try {
|
|
10
|
+
const userClisDir = path.join(root, 'user-clis');
|
|
11
|
+
const builtinRoot = path.join(root, 'pkg');
|
|
12
|
+
const builtinClisDir = path.join(builtinRoot, 'clis');
|
|
13
|
+
fs.mkdirSync(path.join(userClisDir, 'instagram'), { recursive: true });
|
|
14
|
+
fs.mkdirSync(path.join(userClisDir, 'twitter'), { recursive: true });
|
|
15
|
+
fs.mkdirSync(path.join(builtinClisDir, 'instagram'), { recursive: true });
|
|
16
|
+
fs.mkdirSync(path.join(builtinClisDir, 'twitter'), { recursive: true });
|
|
17
|
+
fs.writeFileSync(path.join(userClisDir, 'instagram', 'saved.js'), '', 'utf-8');
|
|
18
|
+
fs.writeFileSync(path.join(userClisDir, 'instagram', 'utils.js'), '', 'utf-8');
|
|
19
|
+
fs.writeFileSync(path.join(userClisDir, 'twitter', 'search.js'), '', 'utf-8');
|
|
20
|
+
fs.writeFileSync(path.join(builtinClisDir, 'instagram', 'saved.js'), '', 'utf-8');
|
|
21
|
+
fs.writeFileSync(path.join(builtinClisDir, 'instagram', 'utils.js'), '', 'utf-8');
|
|
22
|
+
fs.writeFileSync(path.join(builtinClisDir, 'twitter', 'search.js'), '', 'utf-8');
|
|
23
|
+
fs.writeFileSync(path.join(builtinRoot, 'cli-manifest.json'), `${JSON.stringify([
|
|
24
|
+
{ site: 'instagram', name: 'saved', sourceFile: 'instagram/saved.js' },
|
|
25
|
+
])}\n`, 'utf-8');
|
|
26
|
+
expect(findShadowedUserAdapters({ userClisDir, builtinClisDir })).toEqual([
|
|
27
|
+
{
|
|
28
|
+
name: 'instagram/saved',
|
|
29
|
+
userPath: path.join(userClisDir, 'instagram', 'saved.js'),
|
|
30
|
+
builtinPath: path.join(builtinClisDir, 'instagram', 'saved.js'),
|
|
31
|
+
},
|
|
32
|
+
]);
|
|
33
|
+
}
|
|
34
|
+
finally {
|
|
35
|
+
fs.rmSync(root, { recursive: true, force: true });
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
it('formats a concise doctor issue', () => {
|
|
39
|
+
const issue = formatAdapterShadowIssue([
|
|
40
|
+
{
|
|
41
|
+
name: 'instagram/saved',
|
|
42
|
+
userPath: '/home/me/.webcmd/clis/instagram/saved.js',
|
|
43
|
+
builtinPath: '/pkg/clis/instagram/saved.js',
|
|
44
|
+
},
|
|
45
|
+
]);
|
|
46
|
+
expect(issue).toContain('instagram/saved');
|
|
47
|
+
expect(issue).toContain('webcmd adapter reset <site>');
|
|
48
|
+
});
|
|
49
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { InternalCliCommand } from './registry.js';
|
|
2
|
+
/**
|
|
3
|
+
* Resolve the editable source file path for an adapter.
|
|
4
|
+
*
|
|
5
|
+
* Priority:
|
|
6
|
+
* 1. cmd.source (set for FS-scanned JS and manifest lazy-loaded JS)
|
|
7
|
+
* 2. cmd._modulePath (set for manifest lazy-loaded JS)
|
|
8
|
+
*
|
|
9
|
+
* Skip manifest: prefixed pseudo-paths (YAML commands inlined in manifest).
|
|
10
|
+
*/
|
|
11
|
+
export declare function resolveAdapterSourcePath(cmd: InternalCliCommand): string | undefined;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as fs from 'node:fs';
|
|
2
|
+
/**
|
|
3
|
+
* Resolve the editable source file path for an adapter.
|
|
4
|
+
*
|
|
5
|
+
* Priority:
|
|
6
|
+
* 1. cmd.source (set for FS-scanned JS and manifest lazy-loaded JS)
|
|
7
|
+
* 2. cmd._modulePath (set for manifest lazy-loaded JS)
|
|
8
|
+
*
|
|
9
|
+
* Skip manifest: prefixed pseudo-paths (YAML commands inlined in manifest).
|
|
10
|
+
*/
|
|
11
|
+
export function resolveAdapterSourcePath(cmd) {
|
|
12
|
+
const candidates = [];
|
|
13
|
+
if (cmd.source && !cmd.source.startsWith('manifest:')) {
|
|
14
|
+
candidates.push(cmd.source);
|
|
15
|
+
}
|
|
16
|
+
if (cmd._modulePath) {
|
|
17
|
+
candidates.push(cmd._modulePath);
|
|
18
|
+
}
|
|
19
|
+
for (const candidate of candidates) {
|
|
20
|
+
if (fs.existsSync(candidate))
|
|
21
|
+
return candidate;
|
|
22
|
+
}
|
|
23
|
+
return candidates[0];
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { resolveAdapterSourcePath } from './adapter-source.js';
|
|
3
|
+
function makeCmd(overrides = {}) {
|
|
4
|
+
return {
|
|
5
|
+
site: 'test-site',
|
|
6
|
+
name: 'test-cmd', access: 'read',
|
|
7
|
+
description: 'test',
|
|
8
|
+
args: [],
|
|
9
|
+
...overrides,
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
describe('resolveAdapterSourcePath', () => {
|
|
13
|
+
it('returns source when it is a real file path (not manifest:)', () => {
|
|
14
|
+
const cmd = makeCmd({ source: '/home/user/.webcmd/clis/arxiv/search.js' });
|
|
15
|
+
expect(resolveAdapterSourcePath(cmd)).toBe('/home/user/.webcmd/clis/arxiv/search.js');
|
|
16
|
+
});
|
|
17
|
+
it('skips manifest: pseudo-paths and falls back to _modulePath', () => {
|
|
18
|
+
const cmd = makeCmd({ source: 'manifest:arxiv/search', _modulePath: '/pkg/clis/arxiv/search.js' });
|
|
19
|
+
expect(resolveAdapterSourcePath(cmd)).toBe('/pkg/clis/arxiv/search.js');
|
|
20
|
+
});
|
|
21
|
+
it('returns undefined when only manifest: pseudo-path and no _modulePath', () => {
|
|
22
|
+
const cmd = makeCmd({ source: 'manifest:test/cmd' });
|
|
23
|
+
expect(resolveAdapterSourcePath(cmd)).toBeUndefined();
|
|
24
|
+
});
|
|
25
|
+
it('returns _modulePath when it is the only path available', () => {
|
|
26
|
+
const cmd = makeCmd({ _modulePath: '/project/clis/site/cmd.js' });
|
|
27
|
+
expect(resolveAdapterSourcePath(cmd)).toBe('/project/clis/site/cmd.js');
|
|
28
|
+
});
|
|
29
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const PRODUCT_NAME = "webcmd";
|
|
2
|
+
export declare const PRODUCT_DISPLAY_NAME = "Webcmd";
|
|
3
|
+
export declare const CLI_COMMAND = "webcmd";
|
|
4
|
+
export declare const PACKAGE_NAME = "@agentrhq/webcmd";
|
|
5
|
+
export declare const CONFIG_DIR_NAME = ".webcmd";
|
|
6
|
+
export declare const ENV_PREFIX = "WEBCMD";
|
|
7
|
+
export declare const DAEMON_HEADER_NAME = "X-Webcmd";
|
|
8
|
+
export declare const EXTENSION_PACKAGE_NAME = "webcmd-extension";
|
|
9
|
+
export declare const EXTENSION_ARTIFACT_PREFIX = "webcmd-extension";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export const PRODUCT_NAME = 'webcmd';
|
|
2
|
+
export const PRODUCT_DISPLAY_NAME = 'Webcmd';
|
|
3
|
+
export const CLI_COMMAND = 'webcmd';
|
|
4
|
+
export const PACKAGE_NAME = '@agentrhq/webcmd';
|
|
5
|
+
export const CONFIG_DIR_NAME = '.webcmd';
|
|
6
|
+
export const ENV_PREFIX = 'WEBCMD';
|
|
7
|
+
export const DAEMON_HEADER_NAME = 'X-Webcmd';
|
|
8
|
+
export const EXTENSION_PACKAGE_NAME = 'webcmd-extension';
|
|
9
|
+
export const EXTENSION_ARTIFACT_PREFIX = 'webcmd-extension';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { CLI_COMMAND, CONFIG_DIR_NAME, DAEMON_HEADER_NAME, ENV_PREFIX, EXTENSION_ARTIFACT_PREFIX, EXTENSION_PACKAGE_NAME, PACKAGE_NAME, PRODUCT_DISPLAY_NAME, PRODUCT_NAME, } from './brand.js';
|
|
3
|
+
describe('webcmd brand constants', () => {
|
|
4
|
+
it('defines AgentR webcmd identity', () => {
|
|
5
|
+
expect(PRODUCT_NAME).toBe('webcmd');
|
|
6
|
+
expect(PRODUCT_DISPLAY_NAME).toBe('Webcmd');
|
|
7
|
+
expect(CLI_COMMAND).toBe('webcmd');
|
|
8
|
+
expect(PACKAGE_NAME).toBe('@agentrhq/webcmd');
|
|
9
|
+
expect(CONFIG_DIR_NAME).toBe('.webcmd');
|
|
10
|
+
expect(ENV_PREFIX).toBe('WEBCMD');
|
|
11
|
+
expect(DAEMON_HEADER_NAME).toBe('X-Webcmd');
|
|
12
|
+
expect(EXTENSION_PACKAGE_NAME).toBe('webcmd-extension');
|
|
13
|
+
expect(EXTENSION_ARTIFACT_PREFIX).toBe('webcmd-extension');
|
|
14
|
+
});
|
|
15
|
+
});
|